package com.example.springaop.service;

import com.example.springaop.Mapper.LogInfoMapper;
import com.example.springaop.model.UserInfo;
import com.example.springaop.Mapper.UserMode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
public class UserService {
    @Autowired
    private UserMode userMode;
    @Autowired
    private LogInfoMapper logInfoMapper;
    @Transactional(propagation = Propagation.MANDATORY)
    public Integer insert(String userName ,String password) {
        return userMode.insert(userName,password);
    }
    @Transactional(propagation = Propagation.SUPPORTS)
    public Integer insertLog(String userName,String op){
        return logInfoMapper.insertLog(userName, op);
    }
}
